package edu.kjxy.worker0308;

import java.util.Scanner;

public class worker01 {

	public static void main(String[] args) {
		System.out.println("请输入货物重量：");
		
		Scanner in = new Scanner(System.in);
		double weight = in.nextDouble();
		in.close();
		double price = 0.0;
		if(weight <= 20)
		{
			price = 10;
		}
		else if(weight <=50)
		{
			price = 10 + (weight - 20) * 1.5;
		}
		else if(weight <= 100)
		{
			price = 10 + (50 - 20) * 1.5 + (weight - 50) * 2;
		}
		else
		{
			price = 10 + (50 - 20) * 1.5 + (100 - 50) * 2 + (weight - 100) * 2.5;
		}
		System.out.println("托运费用为：" + price);
	}

}
